home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor2
/
smtk.exe
/
SMTK.DOC
Wrap
Text File
|
1993-01-21
|
70KB
|
1,914 lines
@@
@@@@
@@@
@@ @ @@
@@@ @ @@@
@@@@ @ @@
@@@@ @@ @@ @@@ @@@@@ @@@@@ @@@ @@@@@ @ @@ @@@@@
@@ @@@ @@@ @@@@@ @@@@@ @@@@@ @@ @ @ @@ @
@@@@@@@@@@@@@@ @ @@@@ @ @@ @@ @ @ @ @@@ @@@@@ @ @@ @@@@@@
@@@@@@@@@@@@@@ @ @@ @ @ @ @ @@@@ @ @ @@ @ @ @@ @@@@@@
@@ @@ @@ @ @@@ @ @ @@ @ @ @@ @@@@@@ @ @@ @
@@@@ @@ @@ @ @@@ @ @ @@ @ @ @@ @@@@@ @@@ @@@@@
@@@@ @
@@@ An Advanced-Customization Tool @@@@@@
@@ @@@@
@@@ COPYRIGHT (C) 1992-93
@@@@
@@ Simone A. Rapisarda Version 1.59 (16 Gen 1993)
# # #### ##### #### # ####
# # # # # # # #
# # ### #### #### ###
# # # # # # #
### #### ##### # # ####
# # ### # # # # ### #
## ## # # ## # # # # # #
# # # ##### # # # # # ##### #
# # # # # ## # # # # #
# # # # # # ### # # #####
CONTENTS
1. Introduction........................................................ 1
1.1 Description of the Library.................................... 1
1.2 Releasing Notes............................................... 2
1.3 Acknowledgements.............................................. 3
2. SmartKeys Commands.................................................. 4
2.1 Important Notes............................................... 4
2.2 Commands in the SmartKeys Menu................................ 7
2.3 Description of each Command (in order of appearance).......... 8
ASNK.......................................................... 8
RCLK.......................................................... 8
DELK.......................................................... 9
DISPK......................................................... 9
STDK.......................................................... 9
RECK.......................................................... 10
KEYN.......................................................... 10
\->IFCMDTE.................................................... 11
\->IFIMMTE.................................................... 11
\->IFPRGTE.................................................... 11
\->IFALGTE.................................................... 11
\->IF1KTE..................................................... 12
\->EVL........................................................ 12
\->PSH........................................................ 12
\->EDIT....................................................... 12
\->EQW........................................................ 12
ADDFR......................................................... 13
'BADK......................................................... 13
\->KB......................................................... 13
KB\->......................................................... 14
\->KBN........................................................ 14
KBN\->........................................................ 14
KBNM.......................................................... 14
KBMN.......................................................... 14
GETKEYS....................................................... 15
PUTKEYS....................................................... 15
PACKKEYS...................................................... 15
DOKEY......................................................... 16
SAFE.......................................................... 16
DUAL.......................................................... 16
\->CSTM....................................................... 16
\->MENU....................................................... 17
HTRIM......................................................... 17
ABOUTSK....................................................... 17
$CONFIG....................................................... 18
3. Command Usage Examples.............................................. 19
3.1 Commands used: \->IFPRGTE ASNK................................ 19
3.2 Commands used: STDK \->IFCMDTE ASNK........................... 19
3.3 Commands used: KEYN RECK ASNK................................. 20
3.4 Commands used: \->PSH \->EVL \->IFPRGTE \->EDIT \->IFCMDTE.... 20
3.5 Command used: DOKEY........................................... 21
3.6 Command used: SAFE............................................ 21
3.7 Command used: DUAL............................................ 22
3.8 Command used: \->IF1KTE....................................... 22
3.9 Command used: \->MENU......................................... 22
Appendixes.......................................................... 23
A Unused and Useless HP48 Default Key Assignments............... 23
B The Internal UserKeys List.................................... 24
C Quick Reference Guide......................................... 25
1. Introduction
----------------
1.1 Description of the Library
SmartKeys was born as a Library of utilities designed to increase the
power of the already powerful HP48 User Keyboard capability. Even if
this still remains its main goal, some new commands do not have any
relation with the User Keyboard but, more generally, with the
customization of the calculator, making of SmartKeys an advanced
customization tool for the HP48.
SmartKeys is a self-attaching Library entirely written in sys-RPL.
It's 5675 bytes long and it's identified by the Library ID 1616. The
commands it contains were mainly conceived for these purposes:
- Facilitate the usage of key assignments.
Commands: ASNK RCLK DELK DISPK KEYN PACKKEYS
- Increase the speed of User Keyboard operations.
Commands: ASNK RCLK DELK DISPK KEYN PACKKEYS GETKEYS PUTKEYS ADDFR
- Save key assignment memory.
Commands: ASNK DELK STDK PACKKEYS
- Allow special key assignments normally not supported.
Commands: STDK RECK \->EVL \->PSH \->EDIT \->EQW \->IFCMDTE
\->IFIMMTE \->IFPRGTE \->IFALGTE \->IF1KTE 'BADK
- Increase the number of possible assignments on a single key.
Commands: \->IFCMDTE \->IFIMMTE \->IFPRGTE \->IFALGTE \->IF1KTE
- Fill the gaps in the HP48 default key assignments.
Commands: STDK RECK \->IFCMDTE \->IFIMMTE \->IFPRGTE \->IFALGTE
- Allow the usage of more than one User Keyboard.
Commands: \->KB KB\-> \->KBN KBN\-> KBNM KBMN GETKEYS PUTKEYS
- Help the User Keyboard always stay active.
Command: $CONFIG (hidden)
- Handy use of tree-structured menus.
Commands: \->CSTM \->MENU
- Reconfigure the calculator after a warm-start.
Command: $CONFIG (hidden)
- Provide a way to transform dangerous programs into Safe programs.
Command: SAFE
- Allow multiple ways of execution for any program.
Command: DUAL
- Allow key-like execution in user programs.
Command: DOKEY
- Help the user to have a clean and tidy HOME directory.
Command: HTRIM
Page 1
1.2 Releasing Notes
English is not my native language and it was not one of my favourite
subjects at school. I have done my very best to write this manual in
an understandable form but I might not succeed, so I hope you will
excuse the simple words I use and any possible mistake or impropriety.
SmartKeys has been validated on an HP48 revision E. It should work fine
for HP 48 revisions A through E. It may not work correctly for later
HP 48 revisions. In march 1993 the developing platform of SmartKeys
will change from an HP48 revision E to an HP48 revision J, till then
I won't be able to say how it works with the new ROM revision so be
careful.
All the commands and programs contained in SmartKeys came from *my own*
ideas and experimentations. Every algorithm I used was conceived and
developed by me except those reprised from the HP48 built-in ROM.
The only exception to this are the Library_Data-handling programs used
in KB\-> and \->KB that were conceived and written by Detlef Mueller
and Raymond Hellstern.
SmartKeys is distributed in the hope that it will be useful; even if
its commands have been tested (on a HP48 revision E) they make use of
undocumented features, so use them at your own risk: I take no
responsibility for any damage caused by their use or misuse.
The SmartKeys Library and this manual are Copyright (C) 1992-93 by
Simone A. Rapisarda. Non-commercial distribution is allowed and
encouraged if this manual, unchanged, accompanies the unmodified
Library.
You can extract and use parts of SmartKeys in other libraries or
programs only if these are Public Domain or Freeware. Anyway this
should be done only with my consent and their use and origin must be
reported in the documentation of the software.
SmartKeys is GiftWare. This means that if after a period of evaluation
you find it useful and you think I deserve a contribution for all the
time I spent working on it (not a little, believe me!), feel free to
send me a gift: cookies, chocolate, cakes, Alka-Seltzers, a 512K RAM
card etc. ;-). But if you can't afford a gift don't worry, a postcard
to the following address will be also welcome:
Simone A. Rapisarda
via Livia Gereschi, 6
56127 PISA
ITALY
If you have comments, suggestions, questions, or criticisms, I would
really like to receive them at the above address. I will reply to
every letter. If you have Email access you can also reach me using
the following address:
Simone_Rapisarda@p10.f800.n33.z2.fidonet.org
Page 2
1.3 Acknowledgements
- To Joe Horn and Detlef Mueller for their precious suggestions.
- To Joe Horn again, for is help in writing the manual.
- To Flavia Majlis, Pablo Majlis, Roberto Taddei and Paolo Gozzini, for
their help in correcting my bad english.
- To Flavia Majlis again, that created the nice SmartKeys screen
displayed by the command ABOUTSK.
- To Rick Grevelle, for his great HACKIT Library that helped me a lot
in developing the earlier versions of SmartKeys and discovering many
of the HP48 undocumented features used in it.
- To Detlef Mueller and Raymond Hellstern, for the ML programs to
handle Library Data objects and for their RPL48, a wonderful Sys-RPL
development toolkit for the HP48SX that have saved me a lot of work
and time.
- Most of the entry points used to compile SmartKeys are documented in
a List supplied by Jake Schwartz. I thank him and all the
contributors to that List.
- To Johann Sebastian Bach and Antonio Vivaldi for the spiritual
inspiration and confort their music gave me during night-time endless
hacking.
Page 3
2. SmartKeys Commands
----------------------
2.1 Important Notes
Please read at least all this chapter before using the Library.
A If you aren't familiar with the arguments and/or terms used in this
manual I suggest you first read the 15th chapter of the HP48 User's
Manual: "Customizing the Calculator".
B All the SmartKeys commands do complete argument checking and are
completely "idiot proof" so it's very unlikely that using them
would cause a disaster.
C If you use the Multi Keyboard Capability (commands \->KB, KB\->,
\->KBN, KBN\->, KBNM, KBMN or USRM, STUSR, RCUSR, DOUSR, DLUSR in
older versions) then, every time you update to a new version of
SmartKeys (as soon as the new version is attached), you MUST
execute immediately the following program so as to avoid disastrous
effects:
%%HP: T(3);
\<< KBNM \->KB \>>
D If you use the Advanced Menu System (command \->CSTM or CRCSTM in
older versions) then, every time you update to a new version of
SmartKeys (as soon as the new version is attached), you MUST
execute immediately the following program so as to avoid disastrous
effects:
%%HP: T(3);
\<< HOME CSTM \->CSTM \>>
E The built-in commands ASN, STOKEYS, RCLKEYS and DELKEYS are not
well written. The SmartKeys commands ASNK, DELK and PACKKEYS have
been written using some contrivances in order to save a theoretical
maximum of 1470 bytes in each internal UserKeys List. If you want
to take advantage of this it's best not to use the built-in
commands ASN, STOKEYS and DELKEYS at all, and use SmartKeys
commands exclusively.
F The commands ASNK(1), RCLK(1), DELK(1) and STDK(1) support all six
possible assignments for all keys, except some combinations of the
two shift keys, obviously.
G The commands ASNK, RCLK, DELK, DISPK, GETKEYS, PUTKEYS and PACKKEYS
work only on the current UserKeys List.
Page 4
H rc.p represents a Real that identifies a key location: r stands for
row, c stands for column and p stands for plane.
I The normal HP48 keyboard has several keys that behave strangely.
For example, the CLVAR key (blue-DEL key), has a built-in safety
feature: it doesn't execute immediately, but instead puts itself
onto the command line, so that you must then press ENTER if you
really want it to execute. This allows you to press ATTN to clear
the command line if you pressed CLVAR by mistake. This is therefore
called a Safe key. SmartKeys allows you to create your own Safe key
assignments and programs. Its own ->KB command is a Safe command.
J SmartKeys even allows you to create Dual keys and programs, which
are like Safe keys except that the action performed from the
keyboard is up to you. Many of the SmartKeys commands are Dual
functions; for example, ABOUTSK displays an "about" screen when
pressed from the keyboard; but, when executed from a program (or
command line), it places the SmartKeys version String on the stack.
K \->CSTM and \->MENU considerably enhance the HP48 Menu System
allowing the creation of tree-structured menus that support new and
powerful types of Menu Entries and Menu Labels in a really simple
and handy way.
With the advent of the sys-RPL era many utility have been written
to solve the tree-structured menus built-in limitation. All these
programs worked out only a part of the problem, a big part of it
was that the tree-structured menus (expecially the big ones)
created by them cannot be (at least, easely) edited and modified;
These are the reasons:
- Not editable instructions (the misterious 'External') are
involved.
- The built-in editor is very slow, expecially for big objects.
- It's not easy to keep track of every '{' and '}' so to know
exactly where you are.
\->CSTM and \->MENU solves completely all the aspects of the
problem.
The Advanced Menu System supported by \->CSTM and \->MENU accepts
Menu Lists with the same format of those accepted by the Built-in
Menu System. The new types of menu entries are described in the
following table:
Page 5
+=================================================================+
| |
| If the Menu Entry is a Global Name then the Menu-Label |
| identifier and the action performed by the not-shifted key |
| depend on the content of the Global variable: |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
| |
| CONTENT LBL-ID ACTION |
| |
| Directory _ Enter the Directory |
| (as usual) |
| |
| TakeOver Program Always evaluate the Global Name |
| ('Always' here means that if, for |
| example, the command line is active, |
| the Global Name is not inserted in |
| the command line as usual but just |
| evaluated. |
| To obtain a TakeOver Program use |
| the command \->EVL) |
| |
| List _ Always display the List as an |
| Advanced Menu |
| (The nesting of Advanced Menus has |
| no limits; So your tree-structured |
| menus may grow for kilobytes and |
| kilobytes without loosing in |
| readability and editability: When |
| you want to edit a sub-sub-...-menu |
| you only need to edit the content of |
| the corresponding Global variable. |
| I suggest you to store all the |
| Global variables that contain an |
| Advanced Menu List in the HOME |
| directory so as they can be used |
| from every directory; Remember that |
| if you want you can hide them with |
| the command HTRIM) |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
| |
| If the Menu Entry is a Global Name and the Immediate Entry Mode |
| is not active then the right-shifted key inserts the Global |
| name in the command line. |
| |
+=================================================================+
| |
| If the Menu Entry is an XLIB (a Library command) then the |
| action performed by the not-shifted key depends on the content |
| of the XLIB: if it is a TakeOver Program then (as for a Global |
| name Menu Entry) the XLIB is always evaluated, where 'always' |
| means that if, for example, the command line is active, the |
| XLIB name is not inserted in the command line as usual but just |
| evaluated. In case that the Immediate Entry Mode is not active |
| you need to press the right-shifted key in order to insert the |
| XLIB name in the command line. |
| To obtain a TakeOver Program use the command \->EVL. |
| |
+=================================================================+
Page 6
+=================================================================+
| |
| If the Menu Entry is a String beginning with the '&' character |
| then the Menu-Label identifier and the actions performed by the |
| key depend on the rest of the string: |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
| |
| Menu Entry: String: "&..." where ... is a Real number |
| |
| Label Identifier: _ |
| |
| Label Content: Library_Title |
| |
| UnShifted Action: Display the menu of the Library |
| |
| R-Shifted Action: Always Recall the Library to the stack |
| ('Always' here means that the Library is |
| recalled also if it's contained in a ROM |
| Card or in a write-protected RAM Card) |
| |
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
| |
| Menu Entry: String: "&..." where '...' is a Global Name |
| |
| Label Identifier: _____ |
| |
| Label Content: Content of the Global variable |
| |
| UnShifted Action: Evaluate the content of the Global variable |
| |
| L-Shifted Action: Store an object into the Global variable |
| |
| R-Shifted Action: Recall the content of the Global variable |
| or insert the Global name in the command |
| line if not in Immediate Entry Mode |
| |
+=================================================================+
The only limitation of the Advanced Menu System is that, unlike the
Built-in Menu System, it's not functional in the Equation Writer.
L The SmartKeys commands DISPK and KBMN are TakeOver XLIBs so if
they are used in an Advanced Menu they are always evaluated.
2.2 Commands in the SmartKeys menu
+---------------------------------------------------------------------+
| Page 1 Page 2 Page 3 Page 4 Page 5 Page 6 |
+---------------------------------------------------------------------+
| 0 ASNK 6 KEYN 12 ->EVL 18 ->KB 24 GETKEYS 30 ->CSTM |
| 1 RCLK 7 ->IFCMDTE 13 ->PSH 19 KB-> 25 PUTKEYS 31 ->MENU |
| 2 DELK 8 ->IFIMMTE 14 ->EDIT 20 ->KBN 26 PACKKEYS 32 HTRIM |
| 3 DISPK 9 ->IFPRGTE 15 ->EQW 21 KBN-> 27 DOKEY 33 ABOUTSK |
| 4 STDK 10 ->IFALGTE 16 ADDFR 22 KBNM 28 SAFE |
| 5 RECK 11 ->IF1KTE 17 'BADK 23 KBMN 29 DUAL |
+---------------------------------------------------------------------+
Page 7
2.3 Description of each command (in order of appearance)
+------+
| ASNK | (ASsigN Keys)
+------+ (see examples in paragraphs 3.1, 3.2 and 3.3)
This is a Dual command:
(1) When executed from the keyboard:
Needs one argument: (1:Any).
Waits for a key to be pressed and assigns the object in level one to
that key. If an object is already assigned to that key, the command
LASTARG, if active, will push to level one the old assignment. To
abort the command execution you can press any key two times quickly.
(2) When executed by a running program (or from the command line):
Needs two arguments: (2:Any, 1:Real).
When the Real on level one is a 0 the object in level two must be a
List, it is passed to a program that behaves like the built-in
command STOKEYS that is documented on the HP48 User's Manual. For
any other Real ASNK behaves just like the built-in command ASN.
ASNK accepts an empty List instead of the Global Name 'SKEY' (to force
a key to have its standard definition) in order to save keystrokes.
+------+
| RCLK | (ReCalL Keys)
+------+
This is a Dual command:
(1) When executed from the keyboard:
Needs no arguments.
Waits for a key to be pressed and recalls to level one the object
assigned to that key. If no object is assigned to that key, the HP48
will just beep. To abort the command execution you can press any key
two times quickly.
(2) When executed by a running program (or from the command line):
Needs one argument: (1:Real).
Recalls to level two the object assigned to the key specified by the
Real in rc.p format and pushes the Real 1 on level one. If no object
is assigned to that key, only the Real 0 is pushed on level one.
If the argument is the Real 0 all the assignments of the current
User Keyboard are recalled as the built-in command RCLKEYS does.
NOTE: When recalling all the assignments RCLK is three times faster
than RCLKEYS. This happens because RCLK uses a stack based
algorythm instead of the local_variables based algorythm used
by RCLKEYS (strangely the size of both programs is the same).
Page 8
+------+
| DELK | (DELete Keys)
+------+
This is a Dual command:
(1) When executed from the keyboard:
Needs no arguments.
Waits for a key to be pressed and deletes the assignment of that
key. If no object is assigned to that key, the HP48 will just beep.
If an object is assigned to that key, the command LASTARG, if
active, will push to level one the old assignment. To abort the
command execution you can press any key two times quickly.
(2) When executed by a running program (or from the command line):
Needs one argument: (1:Real/List/Global_Name/Local_Name).
Refer to documentation of the built-in command DELKEYS on the HP48
User's Manual.
+-------+
| DISPK | (DISPlay Key assignments)
+-------+
Needs no arguments.
Waits for a key to be pressed and displays on the screen the position
of that key, the number and the name of the current keyboard and the
six objects assigned to that key. To abort the command execution you
can press any key two times quickly.
+------+
| STDK | (recall STandarD Key definition)
+------+ (see example in paragraph 3.2)
This is a Dual command:
(1) When executed from the keyboard:
Needs no arguments.
Waits for a key to be pressed and recalls the standard assignment of
that key. To abort the command execution you can press any key two
times quickly.
(2) When executed by a running program (or from the command line):
Needs one argument: (1:Real).
Since not all the standard key assignments can be recalled using
method (1), this second way is provided. The Real on level one must
be in the same format as required by the built-in command ASN
(rc.p). The standard assignment of the specified key is recalled to
level one.
Page 9
+------+
| RECK | (RECord Keys)
+------+ (see example in paragraph 3.3)
This is a Dual command:
(1) When executed from the keyboard:
Needs no arguments.
Records a sequence of two or more standard keys. The only thing that
distinguishes this recording session from the normal state is the
message RECK displayed in the status area instead of USER. To finish
the recording session you need to press [alpha] [CONT] (key 91.5) or
cause an Error (the key that caused the error will not be recorded).
At this point a program will be pushed to level one (this will not
happen if you have recorded only one key. Use STDK for this), that
is the record: its evaluation will cause the reproduction of the key
sequence; it doesn't need to be processed by \->EVL. For a correct
evaluation, assign it to a key or store it in a Global variable.
RECK will record every key except those pressed while running a
program, even the built-in programs, e.g. the EquationWriter, or the
standard editor. For example, while recording, you can edit
something but the keys pressed while you are in the editor (*not in
the command line*) will not be recorded, and the recording session
will restart when you exit from the editor.
(2) When executed by a running program (or from the command line):
Needs one argument: (1:List).
The List must contain more than one Real number in rc.p format: the
corresponding key sequence will be created on level one as for (1).
The same limitations as for (1) apply.
+------+
| KEYN | (KEY Number)
+------+ (see example in paragraph 3.3)
Needs no arguments.
Asks you to press a key and puts its number in rc format on level one;
then you have to press a key between [1] and [6] (any other key will
just beep) to complete the result with the key plane so that the Real
on level one will be in rc.p format. This particular method allows you
to get the rc.p key identifier of any key, including the shifted shift
keys. To abort the command execution you can press any key two times
quickly.
Page 10
+------------+
| \->IFCMDTE | (make "IF CoMmanD line Then Else" program)
+------------+ (see examples in paragraphs 3.2 and 3.4)
Needs two arguments: (2:Any, 1:Any).
Leaves on level one a program that, when evaluated, checks if there is
the Command Line:
- If yes, it evaluates the level two argument.
- If not, it evaluates the level one argument.
The resulting program doesn't need to be processed by \->EVL.
+------------+
| \->IFIMMTE | (make "IF IMMediate-entry mode Then Else" program)
+------------+
Needs two arguments: (2:Any, 1:Any).
Leaves on level one a program that, when evaluated, checks if the HP48
is in Immediate-Entry Mode:
- If yes, it evaluates the level two argument.
- If not, it evaluates the level one argument.
The resulting program doesn't need to be processed by \->EVL.
For information on Entry-Modes see the HP48 manual at page 76 (page
3-16 in the newer, single-volume Owner's Manual).
+------------+
| \->IFPRGTE | (make "IF PRoGram-entry mode Then Else" program)
+------------+ (see examples in paragraphs 3.1 and 3.4)
Needs two arguments: (2:Any, 1:Any).
Leaves on level one a program that, when evaluated, checks if the HP48
is in Program-Entry Mode:
- If yes, it evaluates the level two argument.
- If not, it evaluates the level one argument.
The resulting program doesn't need to be processed by \->EVL.
For information on Entry-Modes see the HP48 manual at page 76 (page
3-16 in the newer, single-volume Owner's Manual).
+------------+
| \->IFALGTE | (make "IF ALGebraic-entry mode Then Else" program)
+------------+
Needs two arguments: (2:Any, 1:Any).
Leaves on level one a program that, when evaluated, checks if the HP48
is in Algebraic-Entry Mode:
- If yes, it evaluates the level two argument.
- If not, it evaluates the level one argument.
The resulting program doesn't need to be processed by \->EVL.
For information on Entry-Modes see the HP48 manual at page 76 (page
3-16 in the newer, single-volume Owner's Manual).
Page 11
+-----------+
| \->IF1KTE | (make "IF ONE Keystroke Then Else" program)
+-----------+ (see example in paragraph 3.8)
Needs two arguments: (2:Any, 1:Any).
Leaves on level one a program that, when evaluated, checks if there was
a "single click" of the key (as for a computer mouse):
- If yes, it evaluates the level two argument.
- If not (the "double click" case), it evaluates the level one
argument.
The resulting program doesn't need to be processed by \->EVL.
+--------+
| \->EVL | (make "EVaLuate immediately" program)
+--------+ (see example in paragraph 3.4)
Needs one argument: (1:Any).
Leaves on level one a program that, when assigned to a key, or stored
in a menu, is evaluated immediately, even during command line entry
or while using the Matrix Writer (like the RAD key).
+--------+
| \->PSH | (make "PuSH unevaluated immediately" program)
+--------+ (see example in paragraph 3.4)
Needs one argument: (1:Any).
Leaves on level one a program that when assigned to a key, or stored in
a menu, pushes the argument unevaluated to the first level of the
stack, even during command line entry or while using the Matrix Writer.
+---------+
| \->EDIT | (make "EDIT only" program)
+---------+ (see example in paragraph 3.4)
Needs one argument: (1:Any).
Leaves on level one a program that when assigned to a key, or stored in
a menu, inserts the argument in the Command Line at the position of the
cursor. If there is no command line, it is created.
+--------+
| \->EQW | (make "EQuationWriter-able" program)
+--------+
Needs one argument: (1:Any).
This is a powerful type of \->EVL: the object processed by this
command and assigned to a key can be executed also while the Equation
Writer is active; but remember, the stack *must* always be left intact
by the operation. The only part of the display allowed to be affected
by such an operation is the menu bar. If you don't obey to this rule
disastrous effects may occur.
Page 12
+-------+
| ADDFR | (ADD a FReeze program)
+-------+
Needs two arguments: (2:Any, 1:Real).
Every time a program execution finishes, the whole display is updated.
This action often wastes precious time. Many programs do not modify all
the display but only a part of it. (e.g. The command SWAP affects only
the stack area and not the status and the menu areas of the display;
the program \<< -64 SF \>> doesn't affect the display at all). The
ADDFR command adds to the object in level two an instruction that
freezes the display areas specified by the Real on level one. The Real
must be used as for the built-in command FREEZE.
+-------+
| 'BADK | (push "BADKey" program onto stack)
+-------+
Needs no argument.
Pushes on the stack the sys-RPL instruction DoBadKey that is normally
associated with all disabled keys. When evaluated it just beeps and
freezes the screen.
+-------+
| \->KB | (stack TO userKeyBoards)
+-------+
This is a Safe command:
Needs one argument: (1:List) / (1:Library Data)
If the argument is a List:
It creates as many User Keyboards as specified by the dimension of the
List. The only limit to this dimension is the amount of available
memory. The memory occupied by an empty UserKeys List is about 60
bytes. The first object of the List is used to name the current User
Keyboard. The other objects are used to name the other User Keyboards.
If a name already exist, the corresponding User Keyboard is used
instead of a new one. This capability was implemented to help the user
to reorganize the User Keyboards, delete the unneeded ones, add new
ones, reorder and rename them.
If the argument is a Library Data object:
the Library Data object must be the one created by KB\->. It replaces
all the User Keyboards with the ones archived in the Library Data
object.
Page 13
+-------+
| KB\-> | (userKeyBoards TO stack)
+-------+
Needs no arguments.
Recalls the UserKeyboards as a Library Data object and pushes the Real
1 on the stack to say that the operation succeed. If there aren't
UserKeyboards the result will be only a Real 0.
+--------+
| \->KBN | (stack TO userKeyBoard Number/Name)
+--------+
Need one argument: (1:Real) / (1:String)
Activates the specified User Keyboard. The same result can be obtained
by pressing the corresponding named key in the User Keyboards Menu
displayed by KBMN. If USER mode is not active, \->KBN activates it.
For a faster execution you should consider to use a Real instead of a
String.
+--------+
| KBN\-> | (userKeyBoard Name&Number TO stack)
+--------+
Needs no arguments.
Recalls the number of the active User Keyboard and tags it with its
name. If there is only one User Keyboard, the result will be a zero
tagged with the String "Undefined".
+------+
| KBNM | (userKeyBoards NaMes)
+------+
Needs no arguments.
Creates an ordered List containing all the names of the User Keyboards.
If there aren't User Keyboards the result will be an empty List.
+------+
| KBMN | (userKeyBoards MeNu)
+------+
Needs no arguments.
Displays (if it exists) the User Keyboards Menu created by the command
\->KB. This is a normal menu, similar to the MODES one. It allows you
to switch easily and rapidly between all the User Keyboards you have
created. If USER mode is not active, KBMN activates it. The menu
displayed by KBMN has two different behaviours depending on the state
of the user flag 50: if it's clear the menu behaves as a normal one, if
it's set the menu is available only for one choice, after you have
selected an User Keyboard the last menu is automatically redisplayed.
Page 14
+---------+
| GETKEYS | (GET userKEYS)
+---------+
Needs no arguments.
Pushes to level two the current internal UserKeys List and to level one
the Real 1 if unassigned keys are active or the Real 0 if unassigned
keys aren't active. For information on the format of the internal
UserKeys List refer to the appendix B of this manual.
+---------+
| PUTKEYS | (PUT userKEYS)
+---------+
Needs two arguments: (2:List, 1:Real).
Stores the List on level two as the current internal UserKeys List and
the Real on level one as the state of unassigned keys: 0 stands for
"disabled", any other number stands for "enabled". PUTKEYS does a
complete argument checking on the List so to prevent a disaster.
For information on the format of the internal UserKeys List refer to
the appendix B of this manual.
NOTE: If you implement PUTKEYS with a 0 on the first level, your
keyboard may result locked up. To recover from this situation
just press [ON]-[C] and, if the user flag 49 is set, press [ATTN]
exactly when the screen reappears.
+----------+
| PACKKEYS | (PACK userKEYS)
+----------+
Needs no arguments.
Packs the User key assignments into their most compact form to save
memory.
As User key assignments are made or deleted (using the built-in
commands ASN, STOKEYS, DELKEYS) a certain amount of memory is wasted.
You can free this memory for other uses by packing the User key
assignment with PACKKEYS (The SmartKeys commands don't need PACKKEYS to
be used).
NOTE: The command sequence described in the HP48 manual at page 220
[page 15-10 in the newer, single-volume Owner's Manual], RCLKEYS
0 DELKEYS STOKEYS, has a little bug/feature: if the unassigned
keys are disabled (by 'S' DELKEYS), after its execution they will
be all enabled. The command PACKKEYS, instead, do not change the
unassigned keys state. It also packs the User key assignments
into a more compact form almost immediately, unlike the Owner's
Manual routine, which is very slow.
Page 15
+-------+
| DOKEY | (DO KEY object)
+-------+ (see example in paragraph 3.5)
Needs one argument: (1:Any).
Note: DOKEY is only useful within programs; it is not useful from the
keyboard.
Evaluates level one object as it was assigned to a key.
+------+
| SAFE | (disallow immediate execution of key assignment)
+------+ (see example in paragraph 3.6)
Needs two arguments: (2:Any, 1:String).
Note: SAFE is only useful within programs; it is not useful from the
keyboard.
SAFE puts the name of the program on the command line if the program is
executed directly; otherwise, the level two argument is executed. As
for DUAL, the string on level one must contain the name of the program.
The built-in CLVAR key (blue-DEL key) is an example of a Safe key.
+------+
| DUAL | (branch depending on keyboard or program execution)
+------+ (see example in paragraph 3.7)
Needs three arguments: (3:Any, 2:Any, 1:String).
Note: DUAL is only useful within programs; it is not useful from the
keyboard.
If the program containing the DUAL command is executed directly (that
is, by pressing a menu key or a key to which the program or its name is
assigned), DUAL evaluates the argument in level two. Otherwise, if the
program isn't executed directly (that is, by being called from within
another program), the level three argument will be evaluated. The
string on level one must contain the name (Global or XLIB) under which
the program is stored.
+---------+
| \->CSTM | (creates the CSTM and CST variables)
+---------+
This is a Safe command:
Needs one argument: (1:List).
Stores the List in a Global variable named CSTM in the current
directory and overwrites the content of the Global variable CST in the
home directory with a special custom-menu List. From now on to edit or
modify your custom menus you must refer to the Global variables named
CSTM and no more to those named CST. Anyway the custom menu is always
accessed by the [CST] key.
Page 16
+---------+
| \->MENU | (display temporary advanced MENU)
+---------+ (see example in paragraph 3.9)
Needs one argument: (1:List).
It displays the List as a temporary menu with all the capabilities of
the Advanced Menu System. Unlike the built-in command TMENU, the menu
is displayed also while a program is running.
+-------+
| HTRIM | (Homedir-TRIM)
+-------+
Need one argument: (1:List) / (1:Real)
It works only in the HOME directory.
If the argument is a List HTRIM orders the variables specified in the
List as the built-in command ORDER does (the smaller is the List, the
smaller is the time required), the only difference is that all the
remaining variables becames hidden: you can still use them as usual but
they won't appear on the VAR menu and in the List created by the VARS
command. To hide all the variables use an empty List. If the argument
is the Real 0, HTRIM bring back to light all the hidden variables. This
command is very useful to keep clean and tidy the VAR menu of the HOME
directory.
NOTE: HTRIM makes a complete error check and has worked well under
every test I made but, as it deals with a very delicate part of
the HP48 Operating System, in some particular case it can cause
problems, expecially if you're not using well-written software.
+---------+
| ABOUTSK | (ABOUT SmartKeys)
+---------+
Needs no arguments.
This is a Dual command:
(1) When executed from the keyboard:
Shows the Library version and a copyright message.
(2) When executed by a running program (or from the command line):
Puts on level one the version String of the Library (so SmartKeys-
based programs can prevent errors).
Page 17
+---------+
| $CONFIG | (hidden)
+---------+
Needs no argument.
It's automatically executed after every warm-start (e.g. [ON]-[C]).
It checks if the user flag 49 is set; if yes, it sets the system flags
-61 ([USR] once to lock) and -62 (User Mode active). So if you wish to
stay in USER mode permanently, set flag 49 and the User Keyboard will
be always active.
This hidden command gives you also the possibility to reconfigure your
calculator after a warm-start: if you store a program in a Global
variable named CONFIG and contained in the Home directory then it will
be automatically executed just after the warm-start.
Page 18
3. Commands Usage Examples
---------------------------
3.1 Commands used: \->IFPRGTE ASNK
When not in Program-Entry Mode the command SWAP is usually executed by
pressing [ > ] (key 36.1) so the combination [orange shift] [ > ]
serves no purpose.
Now you can assign to [orange shift] [ > ] a program that, when in
Program-Entry Mode, will insert SWAP in the command line as usual but
when in Immediate-Entry Mode will implement an OVER.
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: SWAP| |2: |
|1: OVER| |1: |
|### ### ### ### ### ###| |### ### ### ### ### ###|
`-----------------------' `-----------------------'
1) Enter the List { SWAP 2) Press \->IFPRGTE to obtain
OVER } and press OBJ\-> the new assignment.
followed by DROP to obtain Press ASNK and then the
the two command unevaluated. [orange shift] [ > ] key
to assign it to that key.
3.2 Commands used: STDK \->IFCMDTE ASNK
The [DEL] key serves no purpose when there isn't a command line.
Now you can assign to it a program that when the command line is not
present will execute LASTARG, otherwise it will behave like the normal
[DEL] key.
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: External External ..| |2: |
|1: LASTARG| |1: |
|### ### ### ### ### ###| |### ### ### ### ### ###|
`-----------------------' `-----------------------'
1) Implement STDK and press 2) Press \->IFCMDTE to obtain
[DEL] to recall the key the new [DEL] key assignment.
routine. Enter the List Press ASNK and then the [DEL]
{ LASTARG } and press key to assign the program in
OBJ\-> DROP to obtain the level one to it.
LASTARG command.
Page 19
3.3 Commands used: KEYN RECK ASNK
Usually in order to enter a String you need to use the alpha keyboard
so every time it takes four (or three) keystrokes:
[blue-shift] [ - ] [alpha] ( [alpha] )
Now you can assign to the key [blue-shift] [ - ] a program that
automatically enters the alpha keyboard.
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: | |2: |
|1: { 85.3 61.4 }| |1: |
|### ### ### ### ### ###| |### ### ### ### ### ###|
`-----------------------' `-----------------------'
1) Enter an empty List, then 2) Press [ENTRY], [RECK] and
press KEYN and then [ - ] [ENTER] to convert the List
and [ 3 ] so to obtain the on level one to the
Real number 85.3, press corresponding keys sequence.
[ + ]. Then press KEYN, Finally press ASNK and press
[alpha], [ 4 ] so to obtain the the [blue-shift] [ - ] key so
Real number 61.4, press [ + ]. that the program in level one
(If you keep flag -60 set, is assigned to that key.
use 61.1, not 61.4).
3.4 Commands used: \->PSH \->EVL \->IFPRGTE \->EDIT \->IFCMDTE
Now it's time to build yourself the silliest key assignment ever seen:
It checks if there is the command line and:
- if not, it will start the command line with the String "STARTcmd".
- if yes, it checks if Program-Entry Mode is active and:
- if yes, it will push to the first level the String "PRGon".
- if not, it will evaluate the program \<< "PRG" "off" + \>>.
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: | |2: "PRGon"|
|1: "PRGon"| |1:\<< "PRG" "off" + \>>|
|### ### ### ### ### ###| |### ### ### ### ### ###|
`-----------------------' `-----------------------'
1) Enter the String "PRGon" 2) Enter the program \<< "PRG"
and press \->PSH to make "off" + \>> and press \->EVL
it pushable. to make it evaluable.
Page 20
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: | |2: External External ..|
|1: External External ..| |1: "STARTcmd" Externa..|
|### ### ### ### ### ###| |### ### ### ### ### ###|
`-----------------------' `-----------------------'
3) Press \->IFPRGTE. 4) Enter the String "STARTcmd"
and press \->EDIT to make
it editable.
_________________________ _________________________
|{HOME} | |{HOME} |
|-----------------------| |-----------------------|
|4: | |4: |
|3: | |3: |
|2: | |2: |
|1: External External ..| |1: |
|### ### ### ### ### ###| |SILLY #################|
`-----------------------' `-----------------------'
5) Press \->IFCMDTE to 6) I don't think you want to
obtain your brand new waste a key for such a
smart key. stupid assignment so:
Enter the String "SILLY",
implement SWAP 2 \->LIST 1
\->LIST to store the program
and the String in a menu
an finally press TMENU.
3.5 Command used: DOKEY
To force a Dual or Safe command to behave as it was assigned to a key
you just need to put the command on the stack and execute DOKEY on it.
For example, the following program will display the SmartKeys screen:
%%HP: T(3);
\<< { ABOUTSK } 1 GET DOKEY \>>
3.6 Command used: SAFE
The following is a Safe program that purges the graphic display:
%%HP: T(3);
\<<
\<< PICT PURGE \>> @ The 'dangerous' code.
"PPICT" @ The name used to store the entire program.
SAFE
\>>
Download (or type in) this program and store it with the name 'PPICT'.
Page 21
3.7 Command used: DUAL
The following is a Dual program that puts "From Keyboard" on level 1
if executed from the keyboard, or "From Program" if executed from a
program:
%%HP: T(3);
\<<
"From Program" @ the code to execute if called by a program
"From Keyboard" @ the code to execute if called from keyboard
"EX3P7" @ the name used to store this entire program
DUAL
\>>
Download (or type in) this program and store it with the name 'EX3P7'.
If you press the 'EX3P7' menu key, you'll see "From Keyboard". But
\<< EX3P7 \>> [ENTER], then EVAL will produce "From Program".
3.8 Command used: \->IF1KTE
The command \->IF1KTE is used internally in the commands ASNK, RCLK,
DELK, DISPK, STDK, KEYN. When they are waiting for a key to be pressed,
if you press a key once, the command is executed normally, if you press
it twice quickly the command is aborted.
3.9 Command used: \->MENU
The following List contains an Advanced Menu, put it on the stack and
execute \->MENU.
%%HP: T(3);
{ 'CST' @ Dir-like menu label: Display the custom menu
"&1616" @ Dir-like menu label: Display the SmartKeys menu
"&IOPAR" @ Full menu label, contains the IOPAR list
DISPK @ Standard menu label: TakeOver XLIB (always evaluated)
}
As you can see, the examples are finished, now it's up to you...
Page 22
Appendixes
----------
A Unused and Useless HP48 Default Key Assignments
In order to take full advantage of the SmartKeys Library you may want
to know what the gaps in the HP48 default key assignments are, so you
can fill them with your own key definitions. If so, the following table
will help you.
+-----------------------------------------------------+
| UNUSED AND USELESS HP48 DEFAULT KEY ASSIGNMENTS |
+-----------++---------------------++-----------------+
| ENTRY || UNUSED || ? USELESS ? |
| MODE ||------+--------------++---------+-------+
| || NUMB | SPECIFICAT. || NUMBER | SPECS |
+-----------++------+--------------++---------+-------+
| IMMEDIATE || 25.3 | BlShft-up || 34.1or2 | GRAPH |
| ENTRY || 34.3 | BlShft-left || 36.1or2 | SWAP |
| MODE || 36.3 | BlShft-right || 55.1or2 | DROP |
| & NO || 51.4 | alpha-ENTER || 91.2or5 | CONT |
| COMMAND || 54.1 | DEL || 91.3or6 | OFF |
| LINE || 54.4 | alpha-DEL || 92.3 | \-> |
| || 55.4 | alpha-BckSpc || 93.2 | , |
| || 62.5 | ` accent || 93.3 | <-' |
| || 62.6 | ' accent || 94.1 | SPC |
| || 63.5 | ^ accent || 94.3 | \<) |
| || 63.6 | ~ accent || | |
| || 64.5 | " accent || | |
| || 64.6 | etc. accent || | |
+-----------++------+--------------++---------+-------+
| IMMEDIATE || | || 34.2 | GRAPH |
| ENTRY || | || 36.2 | SWAP |
| MODE || | || 55.2 | DROP |
| & || | || 91.2or5 | CONT |
| COMMAND || | || 91.3or6 | OFF |
| LINE || | || 92.3 | \-> |
|===========||======|==============||=========|=======|
| PROGRAM || 52.3 | VISIT || 51.2or3 | DUP |
| ENTRY || 53.2 | 2D || 91.2or5 | CONT |
| MODE || 53.3 | 3D || 91.3or6 | OFF |
| || 62.3 | solver || | |
| || 64.3 | eq catalog || | |
| || 72.3 | alrm catalog || | |
+-----------++------+--------------++---------+-------+
Page 23
B The Internal UserKeys List
When no keys are assigned to the User Keyboard, the internal UserKeys
List is empty. When one or more assignments have been made, the
internal UserKeys List contains forty nine Lists, each of which can be
an empty List (if the key has no assignments) or a six element List (if
the key has one or more assignments). Each of these six elements is the
object assigned to the key in keyplane order, or an empty List if that
keyplane has no assignment.
Example: Assuming that no keys are assigned, when you assign the
command % to the key DEF your internal UserKeys List will look
like this:
{ {} {} {} {} {} {}
{} {} {} {} {} {}
{} {{}%{}{}{}{}} {} {} {} {}
{} {} {} {} {} {}
{} {} {} {} {}
{} {} {} {} {}
{} {} {} {} {}
{} {} {} {} {}
{} {} {} {} {} }
Page 24
C Quick Reference Guide
- Contents
Informations
Reserved user-flags
Reserved Global variables
Command Reference
- Informations:
Name: SmartKeys
Version: 1.59
Type: Library
Size: 5675
Checksum: # 6DE4h
Author: Simone A. Rapisarda - via L. Gereschi, 6 56127 PISA ITALY
- Reserved user-flags:
49 (if set: User Mode always active)
50 (if set: Only-one-choice UserKeyboards_Menu)
- Reserved Global variables:
CST (only in the HOME directory)
CSTM
CONFIG (only in the HOME directory)
- Command Reference:
ASNK - ASsigN Keys
Dual(keyboard)-Interactive: ( Any -> )
( List[empty] -> )
Dual(program): ( Any Real[rc.p] -> )
( List[empty] Real[rc.p] -> )
( List Real[0] -> )
RCLK - ReCalL Keys
Dual(keyboard)-Interactive: ( -> Any )
( -> )
Dual(program): ( Real[rc.p] -> Any 1 )
( Real[rc.p] -> 0 )
( Real[0] -> List )
DELK - DELete Keys
Dual(keyboard)-Interactive: ( -> )
Dual(program): ( Real[rc.p] -> )
( Real[0] -> )
( List_of_Reals[rc.p] -> )
( Global_Name/Local_Name['S'] -> )
DISPK - DISPlay Key assignments
Interactive: ( -> )
Page 25
STDK - recall STandarD Key definition
Dual(keyboard)-Interactive: ( -> Any )
Dual(program): ( Real[rc.p] -> Any )
RECK - RECord Keys
Dual(keyboard)-Interactive: ( -> Program )
( -> )
Dual(program): ( List_of_Reals[rc.p] -> Program )
KEYN - KEY Number
Interactive: ( -> Real[rc.p] )
->IFCMDTE - make "IF CoMmanD line Then Else" program
( Any Any -> Program )
->IFIMMTE - make "IF IMMediate-entry mode Then Else" program
( Any Any -> Program )
->IFPRGTE - make "IF PRoGram-entry mode Then Else" program
( Any Any -> Program )
->IFALGTE - make "IF ALGebraic-entry mode Then Else" program
( Any Any -> Program )
->IF1KTE - make "IF ONE Keystroke Then Else" program
( Any Any -> Program )
->EVL - make "EVaLuate immediately" program
( Any -> Program )
->PSH - make "PuSH unevaluated immediately" program
( Any -> Program )
->EDIT - make "EDIT only" program
( Any -> Program )
->EQW - make "EQuationWriter-able" program
( Any -> Program )
ADDFR - ADD a FReeze command
( Any Real[1...7] -> Program )
'BADK - push "BADKey" program onto stack
( -> Program )
->KB - stack TO userKeyBoards
Safe: ( List_of_Names -> )
( Library_Data -> )
KB-> - userKeyBoards TO stack
( -> Library_Data Real[1] )
( -> Real[0] )
\->KBN - stack TO userKeyBoard Number/Name
( Real/String -> )
KBN\-> - userKeyBoard Name&Number TO stack
( -> Tagged[Name:Real] )
Page 26
KBNM - userKeyBoards NaMes
( -> List_of_Strings )
KBMN - userKeyBoards MeNu
( -> )
GETKEYS - GET userKEYS
( -> List Real[0/1] )
PUTKEYS - PUT userKEYS
( List Real[0/1] -> )
PACKKEYS - PACK userKEYS
( -> )
DOKEY - DO KEY-object
( Any -> ... )
SAFE - disallow immediate execution of key assignment
( Any String -> ... )
DUAL - branch depending on keyboard or program execution
( Any Any String -> ... )
\->CSTM - creates the CSTM and CST variables
Safe: ( List[Menu] -> )
\->MENU - display temporary advanced MENU
( List[Menu] -> )
HTRIM - Homedir-TRIM
( List_of_Global_Names -> )
( Real[0] -> )
ABOUTSK - ABOUT SmartKeys
Dual(keyboard): ( -> )
Dual(program): ( -> String[version#] )
Page 27